#import <Foundation/Foundation.h>

#import "../model/User.h"
#import "RequestConfig.h"
#ifndef UserRequest_h
#define UserRequest_h

// @protocol UserProtocol <NSObject>
// @optional
// - (void)loginHandler:(NSDictionary*) res;
// @end


@interface UserReq : NSObject

@property (nonatomic,assign) RequestConfig* config;
- (void)initReq:(RequestConfig*)config;
+ (id)defaultUserRequest;
# pragma user
- (void)login:(LoginReq*)loginReq
      success:(nullable void (^)(void))success
      failure:(nullable void (^)(NSString *reason))failure;

- (void)regist:(RegistReq*)registReq
       success:(nullable void (^)(void))success
       failure:(nullable void (^)(NSString *reason))failure;

- (void)getInfo:(NSString*)userID
        success:(nullable void (^)(UserInfo *info))success
        failure:(nullable void (^)(NSString *reason))failure;

- (void)rename:(NSString*)newName
        success:(nullable void (^)(void))success
        failure:(nullable void (^)(NSString *reason))failure;

@end


#endif /* UserRequest_h */
